home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8153 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: Inter.NL.net!usenet
  2. From: Auke.Reitsma@net.HCC.nl (Auke Reitsma)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: dlist; *not* homework!
  5. Date: Fri, 01 Mar 1996 23:22:21 GMT
  6. Organization: Inter.NL.net, The Internet Provider in The Netherlands.
  7. Message-ID: <4h8144$ruh@altrade.nijmegen.inter.nl.net>
  8. References: <4h2n2mINN2sm@CS.UTK.EDU>
  9. Reply-To: Auke.Reitsma@net.HCC.nl
  10. NNTP-Posting-Host: rt99-19.rotterdam.nl.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. doolin@menkar.cs.utk.edu (David Doolin) wrote:
  14.  
  15. [...]
  16. > I need to take two sorted double linked lists, and merge 
  17. > them into one sorted list.  I have at my
  18. > disposal: Usenet, the Cfaq, working dlist code (part of which
  19. > I wrote, part of which I have linked in).  What I don't have
  20. > is an algorithm.
  21.  
  22. Basic algorithm:
  23.  
  24. - Retrieve the next data item from list 1
  25. - while that data item is 'larger' than the 'current' item in list 2
  26.      make the item following the current item the current item
  27.      (as code: current = current->next; )
  28. - Insert the data item before the current item.
  29.          
  30. > ps. Consider it a work of charity: increasing the use and literacy 
  31. > of C in the Civil Engineering community!
  32.  
  33. Which is what this group is all about anyway ... ;-)
  34.  
  35.  
  36. Greetings from Delft, The Netherlands.
  37.  
  38. Auke Reitsma
  39.  
  40.